package com.mwy.springbootmybatis.controller;

import com.mwy.springbootmybatis.dao.UserDao;
import com.mwy.springbootmybatis.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
public class Controller1 {
    @Autowired
    private UserDao userdao;

    @RequestMapping("/show")
    @ResponseBody
    public List<User> show(){
        List<User> users = userdao.selectAll();
        return users;
    }
}
